package org.rency.mq.activemq.listener;

import org.apache.log4j.Logger;
import org.rency.mq.activemq.listener.factory.MultipleMessageHandlerContainer;

/**
 * <p>
 * </p>
 * 
 * @author zhangjiewen
 * @version $Id: SwitchableMultipleMessageHandlerContainer.java, v 1.0 11:02
 *          zhangjiewen Exp $
 */
public class SwitchableMultipleMessageHandlerContainer extends MultipleMessageHandlerContainer {
	private static final Logger logger = Logger.getLogger(SwitchableMultipleMessageHandlerContainer.class);
	private boolean available = true;

	@Override
	public void init() {
		if (!available) {
			logger.info("消息监听为关闭状态，无须初始化。");
			return;
		}
		logger.info("available=" + available);
		super.init();
	}

	public void setAvailable(boolean available) {
		this.available = available;
	}
}
